package com.globalwave.common.service;

import java.util.List;

import com.globalwave.common.ArrayOrderList;
import com.globalwave.common.ArrayPageList;
import com.globalwave.common.entity.Field;
import com.globalwave.common.entity.View;
import com.globalwave.common.entity.ViewCriterion;
import com.globalwave.common.entity.VirtualEditForm;
import com.globalwave.common.entity.VirtualGrid;

public interface ViewService {
    
    public ArrayPageList<View> query(
            ViewCriterion viewCriterion, 
            int pageIndex, 
            int pageSize,
            ArrayOrderList orderList) 
    throws Exception ;
    
    public VirtualGrid create(String viewAsXML, boolean isGenCode) throws Exception ;
    public View create(View view) throws Exception ;
    
    public void update(View view) throws Exception ;
    public void update(String viewAsXML, boolean isGenCode) throws Exception;
    
    public void delete(View view) throws Exception ;
    public void deleteAll(Long[] ids) throws Exception ;
    

    public View get(Long id) throws Exception ;
    public View get(String id) throws Exception ;
	public View get(String viewCode, String type) throws Exception ;
    
    public List<Field> getFieldsBySql(String sql) throws Exception ;

    public VirtualGrid getUIMetaData(Long viewId, String viewCode) throws Exception ;
   
    public VirtualEditForm getEditFormMetaData(String viewCode) throws Exception ;
    
    public List<View> getTables(String dbName) throws Exception ;
}
